//
//  DIYNavigationBar.m
//  Travel assistant
//
//  Created by lanou3g on 16/2/27.
//  Copyright © 2016年 旅游助手. All rights reserved.
//

#import "DIYNavigationBar.h"

@implementation DIYNavigationBar
- (instancetype)initWithFrame:(CGRect)frame{
    if ([super initWithFrame:frame]) {
        
    }
    return self;
}

- (void)layoutSubviews{
    [super layoutSubviews];
    [self setViews];
    
    
}
- (void)setViews{
    self.leftBarButton = [UIButton buttonWithType:UIButtonTypeSystem];
    self.leftBarButton.frame = CGRectMake(Screen_W - 40, 10, 25, 30);
    self.leftBarButton.backgroundColor = [UIColor redColor];
    [self addSubview:self.leftBarButton];
    [self.leftBarButton addTarget:self action:@selector(leftBarButtonAction:) forControlEvents:UIControlEventTouchDown];
    
    self.rightBarButton = [UIButton buttonWithType:UIButtonTypeSystem];
    self.rightBarButton.frame = CGRectMake(15, 10, 25, 30);
    self.rightBarButton.backgroundColor = [UIColor redColor];
    [self addSubview:self.rightBarButton];
    [self.rightBarButton addTarget:self action:@selector(rightBarButtonAction:) forControlEvents:UIControlEventTouchDown];
    
    self.travelImV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine"]];
    self.travelImV.frame = CGRectMake(CGRectGetMaxX(self.rightBarButton.frame) + 5 , CGRectGetMinY(self.rightBarButton.frame) , 30, 30);
    self.travelImV.backgroundColor = [UIColor cyanColor];
    [self addSubview:self.travelImV];
    
    self.lineLable = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.travelImV.frame) + 5 , CGRectGetMinY(self.travelImV.frame) , 100, 30)];
    self.lineLable.backgroundColor = [UIColor redColor];
    [self addSubview:self.lineLable];
}
- (void)leftBarButtonAction:(UIButton *)sender{
    NSLog(@"leftBarButtonAction");
    
}
- (void)rightBarButtonAction:(UIButton *)sender{
    NSLog(@"rightBarButtonAction");
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
